package cn.sumpu.app.guoguojie.web.mvc.discuss;

import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import cn.sumpu.app.guoguojie.biz.AlbumBiz;
import cn.sumpu.app.guoguojie.biz.CmsContentBiz;
import cn.sumpu.app.guoguojie.biz.DiscussBiz;
import cn.sumpu.app.guoguojie.biz.DoingTagShowBiz;
import cn.sumpu.app.guoguojie.biz.IdentifierBiz;
import cn.sumpu.app.guoguojie.biz.MemberBiz;
import cn.sumpu.app.guoguojie.biz.PictorialBiz;
import cn.sumpu.app.guoguojie.biz.PictorialTopicBiz;
import cn.sumpu.app.guoguojie.constant.Channel;
import cn.sumpu.app.guoguojie.constant.PictureType;
import cn.sumpu.app.guoguojie.domain.CmsContent;
import cn.sumpu.app.guoguojie.domain.Comment;
import cn.sumpu.app.guoguojie.domain.Discuss;
import cn.sumpu.app.guoguojie.domain.DiscussTag;
import cn.sumpu.app.guoguojie.domain.DoingPictorial;
import cn.sumpu.app.guoguojie.domain.DoingPictorialTopic;
import cn.sumpu.app.guoguojie.domain.DoingPicture;
import cn.sumpu.app.guoguojie.domain.Member;
import cn.sumpu.app.guoguojie.domain.OnLineUserListener;
import cn.sumpu.app.guoguojie.domain.PictorialDoing;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;
import cn.sumpu.app.guoguojie.util.Common;
import cn.sumpu.app.guoguojie.util.Encode;
import cn.sumpu.app.guoguojie.util.PageModel;
import cn.sumpu.app.guoguojie.util.PictureUrl;
import cn.sumpu.app.guoguojie.web.mvc.misc.DiscussController;

@Controller
public class DiscussAController {
    private final static Logger logger = LoggerFactory.getLogger(DiscussController.class);
    @Autowired
    private DiscussBiz          discussBiz;
    @Autowired
    private AlbumBiz            albumBiz;
    @Autowired
    private CmsContentBiz       cmsContentBiz;
    @Autowired
    private PictorialTopicBiz   pictorialTopicBiz;
    @Autowired
    private DoingTagShowBiz     tagBiz;
    @Autowired
    private IdentifierBiz       identifierBiz;
    @Autowired
    private CmsContentBiz       contentBiz;
    @Autowired
    private PictorialBiz   pictorialBiz;
    @Autowired
    private MemberBiz memberBiz;
    

   /* @Autowired
    private CmsContentBiz  cmsContentBiz;*/

    /* 文稿底层页 */
    @RequestMapping(value = "/discuss.htm")
    public String forumList(Integer page, String id, HttpServletResponse response, HttpServletRequest request) {
        try { 
            //id 为推送库标识  
            CmsContent cmsContent =discussBiz.getinDiscussContentById(id);
            PageModel commentModel = discussBiz.getCommentList(id, page); 
            //浏览+1  
            discussBiz.updateDiscussAoumt(id);
            //推送轮播页面100000081
            List<CmsContent> lunboList =cmsContentBiz.getContentList("315ed68d-c4da-4a91-b693-458450f5ee80", 4);
            //推送的标签100000082
            List<CmsContent> amoysTagsList =cmsContentBiz.getContentList("91f6518f-72b1-416e-8cb9-60d735315a49", 20);
            //右边广告
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",2);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("amoysTagsList", amoysTagsList);
            request.setAttribute("lunboList", lunboList);
            request.setAttribute("commentModel", commentModel);
            request.setAttribute("cmsContent", cmsContent);
            request.setAttribute("cmsid", id);
        } catch (AppBusinessException e) {
            e.printStackTrace();
            if (logger.isErrorEnabled()) {
                logger.error("get forumList failure.", e);
            }
        }
        return "v3/discuss/discuss";
    }

    //评论的评论
    @RequestMapping(value = "/savecomment.htm", method = RequestMethod.POST)
    public String savecomment(Comment comment, HttpServletRequest request, HttpServletResponse response, Boolean isShare) {
        response.setContentType("text/html; charset=UTF-8"); 
        PrintWriter pw = null; 
        try {
            Member member = OnLineUserListener.getSessionMember(request);
            if (member == null || !member.getEnabled()) {
                //跳转登录页面
                return "v2/family/login";
            }
            comment.setMember(member.getIdentifier());
            comment.setPostIp(Common.getIp(request));
            discussBiz.insertComment(comment);
            pw = response.getWriter();
            pw.print("true");
        } catch (Exception e) {
            if (logger.isErrorEnabled()) {
                logger.error("get uploadCommentImg failure.", e);
            }
        }
        return null;
    }

    // 上传图片弹出框
    @RequestMapping(value = "/imgUploadComment.htm")
    public String imgUploadComment(HttpServletRequest request, HttpServletResponse response) {
        return "v3/common/uplaodImage";
    }

    /**
     * 上图图片
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/uploadCommentImg.htm")
    public String uploadCommentImg(HttpServletRequest request, HttpServletResponse response) {
        response.setContentType("text/html; charset=UTF-8");
        response.setHeader("Cache-Control", "no-cache");
        PrintWriter pw = null;
        try {
            PictureUrl imageUrl = albumBiz.uploadImage(request, PictureType.COMMENT.getValue(), true);
            pw = response.getWriter();
            pw.print(JSONObject.fromObject(imageUrl));
        } catch (Exception e) {
            e.printStackTrace();
            try {
                pw = response.getWriter();
                String outputJson = "{'err':'上传图片出错！'}";
                pw.print(JSONObject.fromObject(outputJson));
            } catch (Exception e1) {
                if (logger.isErrorEnabled()) {
                    logger.error("get uploadCommentImg failure.", e1);
                }
            }
        }
        return null;
    }

    //文稿的回应
    @RequestMapping(value = "/savereplydis.htm", method = RequestMethod.POST)
    public String savereplydis(Comment comment, HttpServletRequest request, HttpServletResponse response, Boolean isShare) {
        response.setContentType("text/html; charset=UTF-8"); 
        PrintWriter pw = null; 
        try {
            Member member = OnLineUserListener.getSessionMember(request);
            if (member == null || !member.getEnabled()) { 
                //跳转登录页面
                return "v3/member/loginRegister/login";
            }
            comment.setMember(member.getIdentifier());
            comment.setPostIp(Common.getIp(request));
            discussBiz.insertComment(comment);  
            Discuss discuss = discussBiz.getDiscussByDid(comment.getCommentId()); 
            //回复+1 
            discuss.setReplyAmout(discuss.getReplyAmout()+1);
            discussBiz.updateDiscuss(discuss);
            pw = response.getWriter();
            pw.print("true");
        } catch (Exception e) {
            if (logger.isErrorEnabled()) {
                e.printStackTrace();
                logger.error("get uploadCommentImg failure.", e);
            }
        }
        return null;
    }
    
    //文稿画报的底层页 商品的列表页
  /*  @RequestMapping(value = "/prdlshow.htm")
    public String productListShow(String discussId,HttpServletRequest request, HttpServletResponse response) {
        
        
        return "v3/discuss/productListShow";
    }*/

    //文稿画报的底层页 图片的列表页
    @RequestMapping(value = "/piclshow.htm")
    public String pictureListShow(String discussId,Integer page,HttpServletRequest request, HttpServletResponse response) {
        //***discussId 改为传cms_content的标识9月20日
        try {
            CmsContent cmsContent =discussBiz.getinDiscussContentById(discussId);
            Discuss discuss =discussBiz.getDiscussByDid(cmsContent.getTblIdentifier());
            if(discuss!=null){  
                PageModel pictorialModel = pictorialTopicBiz.getTopicPictorialForAmoy(discuss.getThemeId(), page,20); 
                List<DoingPictorial> listName = pictorialTopicBiz.getTopicPictorialForname(discuss.getThemeId());
                request.setAttribute("listName", listName); 
                request.setAttribute("pictorialModel", pictorialModel); 
                request.setAttribute("theme", discuss.getThemeId());
                request.setAttribute("discuss", discuss);
                request.setAttribute("did", discuss.getIdentifier());
                //cms_content的标识
                request.setAttribute("ccid", discussId);
            }
        } catch (AppBusinessException e) {
            e.printStackTrace();
            logger.error("pictureListShow", e);
        }
        return "v3/discuss/pictureListShow";
    }
    //帮淘(主频道)
    @RequestMapping(value = "/amoys.htm")
    public String amoys(HttpServletRequest request, HttpServletResponse response) {
        //包括四个频道的内容
        try {
            //推送轮播页面100000081
            List<CmsContent> lunboList =cmsContentBiz.getContentList("315ed68d-c4da-4a91-b693-458450f5ee80", 4);
            //推送的标签100000082
            List<CmsContent> amoysTagsList =cmsContentBiz.getContentList("91f6518f-72b1-416e-8cb9-60d735315a49", 20);
            //右边广告
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",6);
            // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            Integer pageSize =12;
            List<CmsContent> amoyList =discussBiz.getAmoysList(pageSize);
            request.setAttribute("advList", advList);
            request.setAttribute("amoyList", amoyList);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("ai", "77aa590e-c6e4-4183-9c09-e3a210480251");
            request.setAttribute("lunboList", lunboList);
            request.setAttribute("amoysTagsList", amoysTagsList);
        } catch (AppBusinessException e) {
            logger.error("amoys", e);
        }
        return "v3/amoy/amoys";
    }
    //帮淘 副频道    
    @RequestMapping(value = "/amoy.htm")
    public String amoy(String ai, HttpServletRequest request, HttpServletResponse response) {
        
        try {  
         // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            request.setAttribute("advList", advList);
            Integer num=13;
            List<CmsContent> amoyList =discussBiz.getContentListById(ai,num); 
            List<DiscussTag>   disTagList = discussBiz.getTagByCid(ai);
           //右边广告
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",6);
            request.setAttribute("amoyList", amoyList);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("ai", ai);
            request.setAttribute("disTagList", disTagList);
        } catch (AppBusinessException e) {
            logger.error("amoy", e);
        }
        return "v3/amoy/amoy";
    }
       
    //更多 帮淘 话题列表页面
    @RequestMapping(value = "/amoyshow.htm")
    public String amoyShow(String chl, Integer page,HttpServletRequest request, HttpServletResponse response) {
        
        try {  
         // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            request.setAttribute("advList", advList);
            PageModel amoyModel = discussBiz.getCmsContentListForAmoy(chl, page);
            //推送的标签100000082
            List<CmsContent> amoysTagsList =cmsContentBiz.getContentList("91f6518f-72b1-416e-8cb9-60d735315a49", 20);
            //右边广告
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",6);
            request.setAttribute("amoyModel", amoyModel);
            request.setAttribute("amoysTagsList", amoysTagsList);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("chl", chl);
        } catch (AppBusinessException e) {
            logger.error("amoyShow", e);
        } 
        return "v3/amoy/amoyList";
    }
    //画报更多
    @RequestMapping(value = "/pictorialshow.htm")
    public String amoyPictorialShow(String chl, Integer page,HttpServletRequest request, HttpServletResponse response) {
        
        try {
         // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            request.setAttribute("advList", advList);
            PageModel amoyModel = discussBiz.getCmsContentListForAmoy(chl, page);
          //推送轮播页面100000081
            List<CmsContent> lunboList =cmsContentBiz.getContentList("315ed68d-c4da-4a91-b693-458450f5ee80", 4);
            //推送的标签100000082
            List<CmsContent> amoysTagsList =cmsContentBiz.getContentList("91f6518f-72b1-416e-8cb9-60d735315a49", 20);
            //右边广告 
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",2);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("amoysTagsList", amoysTagsList);
            request.setAttribute("lunboList", lunboList);
            request.setAttribute("amoyModel", amoyModel);
            request.setAttribute("chl", chl);
        } catch (AppBusinessException e) {
            logger.error("amoyShow", e);
        } 
        return "v3/amoy/amoyPictorialList";
    }
    //根据标签查话题
    @RequestMapping(value = "/dislistt.htm")
    public String dislistt(String chl, String tagId,Integer page,HttpServletRequest request, HttpServletResponse response) {
        
        try {
         // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            request.setAttribute("advList", advList);
            PageModel amoyModel = discussBiz.getdislistt(chl,tagId,page);
            //推送轮播页面100000081
            List<CmsContent> lunboList =cmsContentBiz.getContentList("315ed68d-c4da-4a91-b693-458450f5ee80", 4);
            //推送的标签100000082
            List<CmsContent> amoysTagsList =cmsContentBiz.getContentList("91f6518f-72b1-416e-8cb9-60d735315a49", 20);
            //右边广告 
            List<CmsContent>rightGuangGao=cmsContentBiz.getContentList("b4c0eb3e-3a16-46bc-9a75-91c5bfe7734d",2);
            request.setAttribute("rightGuangGao", rightGuangGao);
            request.setAttribute("amoysTagsList", amoysTagsList);
            request.setAttribute("lunboList", lunboList);
            request.setAttribute("amoyModel", amoyModel);
            request.setAttribute("chl", chl);
        } catch (AppBusinessException e) {
            logger.error("amoyShow", e);
        } 
        return "v3/amoy/amoyPictorialList";
    }
    //上图五张图片页面
    @RequestMapping(value = "/imgUploadPicDoing.htm")
    public String imgUploadPicDoing(String theme,String did,HttpServletRequest request, HttpServletResponse response) {
        request.setAttribute("theme", theme);
        request.setAttribute("did", did); 
        return "v3/discuss/imgUploadPicDoing";
    }
    /**
     * 上图五张图片
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/uploadPicImg.htm")
    public String uploadPicImg(HttpServletRequest request, HttpServletResponse response) {
        response.setContentType("text/html; charset=UTF-8");
        response.setHeader("Cache-Control", "no-cache");
        PrintWriter pw = null;
        try {
            PictureUrl imageUrl = albumBiz.uploadImage(request, PictureType.NEWPICTURE.getValue(), true);
            pw = response.getWriter();
            pw.print(JSONObject.fromObject(imageUrl));
        } catch (Exception e) {
            e.printStackTrace();
            try {
                pw = response.getWriter();
                String outputJson = "{'err':'上传图片出错！'}";
                pw.print(JSONObject.fromObject(outputJson));
            } catch (Exception e1) {
                if (logger.isErrorEnabled()) {
                    logger.error("get uploadCommentImg failure.", e1);
                }
            }
        }
        return null;
    }
    //
    @RequestMapping(value = "/saveFiveDoing.htm", method = RequestMethod.POST)
    public String saveFiveDoing(String ptitle,String doingList, String theme,HttpServletRequest request, HttpServletResponse response, Boolean isShare) {
        response.setContentType("text/html; charset=UTF-8"); 
        PrintWriter pw = null; 
        try { 
            Member member = OnLineUserListener.getSessionMember(request);
            if (member == null || !member.getEnabled()) {
                //跳转登录页面
               // return "v2/family/login";
            }
            //画报
            DoingPictorial huabao =new DoingPictorial();
            huabao.setIdentifier(identifierBiz.generateId("doing_pictorial"));
            huabao.setTitle(ptitle);
            huabao.setMember(member.getIdentifier());
            pictorialTopicBiz.saveTopicPictorialForDoingPic(theme, huabao);
           /* //画报-主题关联
            DoingPictorialTopic dpc=new DoingPictorialTopic();
            dpc.setPictorial(huabao.getIdentifier());
            dpc.setPictorialTopic(theme);*/
            //
            JSONArray doingArray = JSONArray.fromObject(Encode.unescape(doingList));
            for (Object object : doingArray) {
                
                JSONObject jsonObj = JSONObject.fromObject(object);
                DoingPicture doingPicture = (DoingPicture) JSONObject.toBean(jsonObj,DoingPicture.class);
                //图片地址
                String pictureThumbnail =doingPicture.getPictureThumbnail();
                //微波内容
                String content =doingPicture.getPicUrl();
                //
                Integer width200xxx=doingPicture.getWidth200xxx();
                
                Integer height200xxx=doingPicture.getHeight200xxx();
                
                discussBiz.insertDoingPic(pictureThumbnail,content,huabao.getIdentifier(),Common.getIp(request),member,height200xxx,width200xxx);
                } 
            pw = response.getWriter();
            pw.print("true");
        } catch (Exception e) {
            e.printStackTrace();
            if (logger.isErrorEnabled()) {
                logger.error("get saveFiveDoing failure.", e);
            }
        }
        return null;
    }

    /**
     * @author BruceZhang
     * @param request
     * @param response
     * @param id    话题ID
     * @param page  页数
     * @return  查询话题微博
     */
    @SuppressWarnings("unchecked")
    @RequestMapping(value = "/discussdoing.htm")
    public String discussdoing(HttpServletRequest request, HttpServletResponse response, String id, Integer page) {
        try {
            CmsContent content = contentBiz.getContentById(id);
            PageModel pageModel = tagBiz.getDoingByDiscuss(content.getTblIdentifier(), page);
            request.setAttribute("id", id);
            request.setAttribute("pageModel", pageModel);
            //
            CmsContent discuss = discussBiz.getinDiscussContentById(id);
            // 取得画报ID
            Discuss disBiz = discussBiz.getDiscuss(id);
            if(disBiz != null){
                PageModel p = pictorialTopicBiz.getTopicPictorial(disBiz.getThemeId(), 1, 1);
                if(p != null && p.getList()!=null && p.getList().size()>0){
                    List<DoingPictorialTopic> dpList = p.getList();
                    if(dpList!=null && dpList.size()>0 && dpList.get(0).getPictorial()!=null){
                        request.setAttribute("pictorialId", dpList.get(0).getPictorial());
                    }
                }
            }
            
            request.setAttribute("discuss", discuss);
            //右边广告
            List<CmsContent> advRight = contentBiz.getContentList(Channel.ADV_RIGHT, 2);
            request.setAttribute("advRight", advRight);
            //话题
            List<CmsContent> topics = contentBiz.getContentList(Channel.AMOYS_TOPIC, 4);
            request.setAttribute("topics", topics);
            // 通栏广告
            List<CmsContent> advList = cmsContentBiz.getContentList("d5bf6647-f349-4bfe-893d-a0640908ac71", 2);
            request.setAttribute("advList", advList);
        } catch (AppBusinessException e) {
            logger.error("查询话题微博(/discussdoing.htm) 出错", e);
        }
        return "v3/discuss/discussdoing";
    }
    //查询画报详情
    @RequestMapping(value = "/picdoingshow.htm")
    public String picdoingshow(HttpServletRequest request, HttpServletResponse response, String plid, Integer page) {
        try { 
            Member myMember = OnLineUserListener.getSessionMember(request);
            DoingPictorial dp=pictorialTopicBiz.getPictorialById(plid);
            //
            PageModel commentModel = discussBiz.getPLCommentList(plid, page);  
             
            //微博画报关联
            List<PictorialDoing> doingList=pictorialTopicBiz.getPictorialDoingForAmoy(dp.getIdentifier());
            if (!Common.empty(myMember)) {
                int follow = memberBiz.checkFollow(myMember.getIdentifier(), dp.getMember());
                request.setAttribute("follow", follow);
            }
            //随机取一个
            DoingPictorial dpOne =discussBiz.getOneForcreator(dp.getMember(),plid); 
            if(dpOne!=null){ 
                List<PictorialDoing> doingListOne=pictorialTopicBiz.getPictorialDoingForAmoy(dpOne.getIdentifier());
                request.setAttribute("doingListOne", doingListOne);
            }
            //访问数+1
            dp.setViewAmount(dp.getViewAmount()+1);
            pictorialBiz.updatePictorial(dp);
            request.setAttribute("dpOne", dpOne);
            request.setAttribute("dp", dp);
            request.setAttribute("plid", dp.getIdentifier());
            request.setAttribute("commentModel", commentModel);
            request.setAttribute("member", memberBiz.getLoginMemberById(dp.getMember()));
            request.setAttribute("doingList", doingList);
            request.setAttribute("myMember", myMember);
        } catch (AppBusinessException e) {
            logger.error("picdoingshow.htm报错了阿", e);
        }
        return "v3/discuss/picDoingShow";
    }
    //回复画报
    @RequestMapping(value = "/saveReplyPldoing.htm", method = RequestMethod.POST)
    public String saveReplyPldoing(Comment comment, HttpServletRequest request, HttpServletResponse response, Boolean isShare) {
        response.setContentType("text/html; charset=UTF-8"); 
        PrintWriter pw = null; 
        try {
            Member member = OnLineUserListener.getSessionMember(request);
            if (member == null || !member.getEnabled()) { 
                //跳转登录页面
                return "v3/member/loginRegister/login";
            }
            comment.setMember(member.getIdentifier());
            comment.setPostIp(Common.getIp(request));
            discussBiz.insertComment(comment);  
            DoingPictorial dp =pictorialTopicBiz.getPictorialById(comment.getCommentId());
            dp.setCommentAmount(dp.getCommentAmount()+1);
            pictorialBiz.updatePictorial(dp);
            pw = response.getWriter();
            pw.print("true");
        } catch (Exception e) {
            if (logger.isErrorEnabled()) {
                e.printStackTrace();
                logger.error("get saveReplyPldoing failure.", e);
            }
        }
        return null;
    }
    //添加画报图片
    @RequestMapping(value = "/addimgFodp.htm")
    public String addimgFodp(String dpid,HttpServletRequest request, HttpServletResponse response) {
        request.setAttribute("dpid", dpid); 
        return "v3/discuss/addimgFodp";
    }
    //
    
    @RequestMapping(value = "/addFiveDoing.htm", method = RequestMethod.POST)
    public String addFiveDoing(String doingList, String dpid,HttpServletRequest request, HttpServletResponse response, Boolean isShare) {
        response.setContentType("text/html; charset=UTF-8"); 
        PrintWriter pw = null; 
        try {  
            Member member = OnLineUserListener.getSessionMember(request);
            if (member == null || !member.getEnabled()) {
                //跳转登录页面
               // return "v2/family/login";
            }
            JSONArray doingArray = JSONArray.fromObject(Encode.unescape(doingList));
            for (Object object : doingArray) {
                
                JSONObject jsonObj = JSONObject.fromObject(object);
                DoingPicture doingPicture = (DoingPicture) JSONObject.toBean(jsonObj,DoingPicture.class);
                //图片地址
                String pictureThumbnail =doingPicture.getPictureThumbnail();
                //微波内容
                String content =doingPicture.getPicUrl();
                //
                Integer width200xxx=doingPicture.getWidth200xxx();
                
                Integer height200xxx=doingPicture.getHeight200xxx();
                discussBiz.insertDoingPic(pictureThumbnail,content,dpid,Common.getIp(request),member,height200xxx,width200xxx);
               } 
            pw = response.getWriter();
            pw.print("true");
        } catch (Exception e) {
            e.printStackTrace();
            if (logger.isErrorEnabled()) {
                logger.error("get saveFiveDoing failure.", e);
            }
        }
        return null;
    }
}
